//
//  UserCheckCell.m
//  NewNest
//
//  Created by hesiyao on 16/1/21.
//  Copyright © 2016年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "UserCheckCell.h"

@implementation UserCheckCell

- (void)dealloc
{
    [_userImg release];
    [_nameLabel release];
    [_contentLabel release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        // 用户头像
        self.userImg = [[UIImageView alloc] init];
        [self.contentView addSubview:_userImg];
        _userImg.layer.cornerRadius = _userImg.frame.size.width / 2;
        _userImg.clipsToBounds = YES;
        [_userImg release];
        
        // 用户名
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_nameLabel];
        [_nameLabel release];
        
        //评价内容
        self.contentLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_contentLabel];
        _contentLabel.numberOfLines = 0;
        _contentLabel.font = [UIFont systemFontOfSize:14];
        [_contentLabel release];
        
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.userImg.frame = CGRectMake(10, 5, self.contentView.frame.size.height / 3, self.contentView.frame.size.height / 3);
    self.nameLabel.frame = CGRectMake(_userImg.frame.origin.x + _userImg.frame.size.width + 10, 5, self.contentView.frame.size.width - _userImg.frame.size.width - 20, _userImg.frame.size.height);
    self.contentLabel.frame = CGRectMake(10, self.contentView.frame.size.height / 3, self.contentView.frame.size.width - 20, self.contentView.frame.size.height / 3 * 2 - 10);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
